<?php
//var_dump($_GET);
$ClassId = $_GET['ClassId'] ?? '';

// 连接数据库
$dsn = "sqlsrv:Server=localhost;Database=Student";
$db = new PDO($dsn, "sa", "123456");

$sql = "delete from Class where ClassId='{$ClassId}';";
$result = $db->exec($sql);
if ($result) {
    echo '删除成功, <a href="class_list.php">返回列表页</a>';
} else{
    echo '删除失败';
}
